<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VUE Template</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>今天天气很{{info}}</h2>
        <button @click="isHot=!isHot">切换天气</button>
    </div>
</body>
    <script type="text/javascript">
        
        const vm = new Vue({
            el:'#root',
            data:{              
                name:'trentwu',
                isHot:true
                
            },
            methods:{
            //   changeWeather(){
            //     this.isHot=!this.isHot
            //   }
            },
            computed:{
                info(){
                    return this.isHot?'炎热':'凉爽'
                }
            }
        })
    </script>
</html>